import * as types from './mutationTypes'

const mutations = {
  [types.SET_PLAYING_STATE] (state, flag) {
    state.playStatus = flag
  },
  [types.SET_FULL_SCREEN] (state, flag) {
    state.fullScreen = flag
  },
  [types.SET_PLAY_LIST] (state, list) {
    state.playList = list
  },
  [types.SET_PLAY_MODE] (state, mode) {
    state.mode = mode
  },
  [types.SET_CURRENT_INDEX] (state, index) {
    state.currentIndex = index
  },
  [types.SET_SEARCH_HISTORY] (state, history) {
    state.searchHistory = history
  },
  [types.SET_PLAY_HISTORY] (state, history) {
    state.playHistory = history
  },
  [types.SET_SHOW_PLAYLIST] (state, flag) {
    state.showPlayList = flag
  },
  [types.SET_TOP_LIST] (state, topInfo) {
    state.topList = topInfo
  }
}

export default mutations
